import Vue from 'vue'
import App from './App.vue'
Vue.config.productionTip = false
import router from '@/router'
import TypeNav from '@/components/TypeNav'
import Carousel from "@/components/Carousel"
import Pagination from "@/components/Pagination"
import store from '@/store'
// 引入mock
import '@/mock/mockService'
// 引入swiper样式
import 'swiper/css/swiper.css'
// 注册全局组件，全局组件不需要单独引入即可使用
Vue.component(TypeNav.name, TypeNav)
Vue.component(Carousel.name, Carousel)
Vue.component(Pagination.name, Pagination)
// import { reqCategoryList } from '@/api'
// console.log(reqCategoryList())
// 挂载全局api
import * as API from '@/api/index'
import { Button, MessageBox } from 'element-ui';
// 图片懒加载
import VueLazyload from 'vue-lazyload'
import pic from '@/assets/2.jpg'
import "@/plugins/validate"
Vue.use(VueLazyload, {
  loading: pic,
})
Vue.component(Button.name, Button);
Vue.prototype.$msgbox = MessageBox;
Vue.prototype.$alert = MessageBox.alert;
new Vue({
  render: h => h(App),
  beforeCreate() {
    // 全局事件总线
    Vue.prototype.$bus = this;
    Vue.prototype.$API = API;
  },
  // 注册路由信息
  router,
  //有了$store
  store
}).$mount('#app')
